<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>条件与循环</title>
</head>

<body>
    <!-- 不仅可以把数据绑定到DOM文本或特性，还可以绑定到DOM结构 -->
    <div id="app-3">
        <p v-if="seen">现在你看到我了</p>
    </div>
    <div id="app-4">
        <ol>
            <li v-for="todo in todos">
                {{todo.text}}
            </li>
        </ol>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app3 = new Vue({
            el: '#app-3',
            data: {
                seen: true
            }
        })
        
        var app4 = new Vue({
            el: '#app-4',
            data: {
                todos: [{
                        text: '学习 Javascript'
                    },
                    {
                        text: '学习 Vue'
                    },
                    {
                        text: '整个项目'
                    }
                ]
            }
        })
    </script>
</body>

</html>